/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.sun.Entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Trasheur
 */
@Entity
@Table(name = "TRUCK")
@NamedQueries({@NamedQuery(name = "Truck.findAll", query = "SELECT t FROM Truck t"), @NamedQuery(name = "Truck.findByTruckid", query = "SELECT t FROM Truck t WHERE t.truckid = :truckid")})
public class Truck implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "TRUCKID")
    private String truckid;
    @OneToMany(mappedBy = "truckid")
    private Collection<Shippingorder> shippingorderCollection;

    public Truck() {
    }

    public Truck(String truckid) {
        this.truckid = truckid;
    }

    public String getTruckid() {
        return truckid;
    }

    public void setTruckid(String truckid) {
        this.truckid = truckid;
    }

    public Collection<Shippingorder> getShippingorderCollection() {
        return shippingorderCollection;
    }

    public void setShippingorderCollection(Collection<Shippingorder> shippingorderCollection) {
        this.shippingorderCollection = shippingorderCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (truckid != null ? truckid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Truck)) {
            return false;
        }
        Truck other = (Truck) object;
        if ((this.truckid == null && other.truckid != null) || (this.truckid != null && !this.truckid.equals(other.truckid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.sun.Entity.Truck[truckid=" + truckid + "]";
    }

}
